
<?php
include '../base/validateAgentLogin.php';
include '../base/layout.php';
?>

<body>

<?php
include '../base/agentheader.php';
?>

<section style="width: 100%;">

    <?php
    include '../base/agentsidemenu.php';
    ?>

    <aside class="content">

        <div style="margin-top: 65px;margin-left: 100px;">
                 <span style="font-size: 50px;">
                        Add Employees
                 </span>
        </div>

        <div style="margin-top: 50px;margin-left: 100px;">
                <span class="user_info_span">
                    Full name
                </span>
            <input class="user_info_input" id="employee_fullname" style="width: 400px;" type="text" value="">
        </div>

        <div style="margin-top: 20px;margin-left: 100px;">
                <span class="user_info_span">
                   Email
                </span>
            <input class="user_info_input" id="employee_email" style="width: 400px;" type="text" value="">

        </div>

        <div style="margin-top: 20px;margin-left: 100px;">
                <span class="user_info_span">
                    Tel
                </span>
            <input class="user_info_input" id="employee_tel" style="width: 400px;" type="text" value="">

        </div>

        <div style="margin-top: 20px;margin-left: 100px;">
                <span class="user_info_span">
                   Wechat
                </span>
            <input class="user_info_input" id="employee_wechat" style="width: 400px;" type="text" value="">

        </div>

        <div style="margin-top: 20px;margin-left: 100px;">
                <span class="user_info_span">
                   Address
                </span>
            <input class="user_info_input" id="employee_address" style="width: 400px;" type="text" value="">

        </div>

        <div style="margin-top: 50px;margin-left: 100px;">
             <span style="font-size: 20px;color: #2B2B2B;letter-spacing: 0px;">
            Resbonsible city
        </span>
            <input type="text" id="resbonsible_city" class="form-control" style="margin-top: 20px;width: 600px;"
                   placeholder="click to input"  value="">

        </div>

        <div style="margin-top: 40px;margin-left: 100px;">
            <button class="btn" id="btnadd" style="background-color: #2B2B2B;color:white;width: 100px;margin-left: 100px;">
                Confirm
            </button>
        </div>

    </aside>

</section>
</body>
</html>
<script>
    $(function () {

        $("#btnadd").click(function () {

            var employee_fullname=$("#employee_fullname").val();
            var employee_email=$("#employee_email").val();
            var employee_tel=$("#employee_tel").val();
            var employee_wechat=$("#employee_wechat").val();
            var employee_address=$("#employee_address").val();
            var resbonsible_city=$("#resbonsible_city").val();


            if(employee_fullname.trim()==""){
                alert(' name is not null ');
                return;
            }
            if(employee_email.trim()==""){
                alert('email tel is not null ');
                return;
            }
            if(employee_tel.trim()==""){
                alert(' tel email is not null ');
                return;
            }
            if(employee_wechat.trim()==""){
                alert(' wechat is not null ');
                return;
            }
            if(employee_address.trim()==""){
                alert(' address  is not null ');
                return;
            }
            if(resbonsible_city.trim()==""){
                alert(' resbonsible city  is not null ');
                return;
            }
            $.ajax( {
                url: '../class/employees/employeesfunction.php',
                data:{
                    method:'add',
                    employee_fullname : employee_fullname,
                    employee_email : employee_email,
                    employee_tel : employee_tel,
                    employee_wechat : employee_wechat,
                    employee_address : employee_address,
                    resbonsible_city : resbonsible_city
                },
                type:'post',
                success:function(data) {
                    if(data==1){

                        window.wxc.xcConfirm('add success', window.wxc.xcConfirm.typeEnum.success);

                    }
                },
                beforeSend: function(){
                    //$('#warning').text('正在处理，请稍等！');
                },
                error : function() {
                    // view("异常！");
                    window.wxc.xcConfirm('add fail', window.wxc.xcConfirm.typeEnum.error);
                }
            });
        });
    })
</script>


